﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Slick.MapEditor;
using Slick.MapEditor.Tools;

namespace Slick
{
    /*
     * Eventually the editor will have a Mode for each loaded map/conversation
     * eg. a list of MapModes and ConversationModes.
     * The Tools/ stuff only works on maps, so they'll call MapMode.GetMap() which will
     * look at EditorMode.CurrentMode, ensure it is a MapMode, and return the correct map.
     * If it isnt a MapMode, it'll error, as they shouldnt be able to use the Maps shizz like that :) 
     * This isn't GUI Shizz, so separate that shit out, boyyyy!
     */

    public static class Editor
    {
        public static IEditorMode CurrentMode = new MapMode(new Map());

        public static void MouseButtonCallback(int button, int down)
        {
            CurrentMode.MouseButtonCallback(button, down);
        }

        public static void MousePositionCallback(int x, int y)
        {
            CurrentMode.MousePositionCallback(x, y);
        }
    }

    public interface IEditorMode
    {
        void MouseButtonCallback(int button, int down);
        void MousePositionCallback(int x, int y);
    }

    public class MapMode : IEditorMode
    {
        public Map Map;
        public ToolController ToolController;

        public MapMode(Map map)
        {
            this.Map = map;
            this.ToolController = new ToolController(Map);
        }

        public void MouseButtonCallback(int button, int down)
        {
            ToolController.MouseButtonCallback(button, down);
        }

        public void MousePositionCallback(int x, int y)
        {
            ToolController.MousePositionCallback(x, y);
        }

    }
}
